<!-- 负责人 -->

<template>
  <FormSelect
    label="负责人"
    bind="principalId, principalName, principalPhone"
    :dict="userDict"
    hasRight
    :rightIndex="2"
    third2
    :required="!!userDict.length"
  />
</template>

<script>
// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出组件 ============================== //

export default {
  /**
   * 名称定义 (实际使用名称)
   */
  name: 'MyPrincipal',

  /**
   * 混入列表 (配置选项合并)
   */
  mixins: [CORE.mixWeb()],

  /**
   * 计算属性 (慎用箭头函数)
   */
  computed: {
    /**
     * 用户字典
     */
    userDict() {
      const { userContent: userList = [] } = this.one
      return userList.map((item) => [item.userId, item.userName, item.userPhone])
    },
  },
}
</script>
